home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM12_A.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  4KB  |  80 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM12_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_handle_count                                        ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of open EMM handles    ;
  7. ;                     (including the operating system handle 0) in the        ;
  8. ;                     system.                                                 ;
  9. ;                                                                             ;
  10. ;           PASSED:   &handle_count:                                          ;
  11. ;                        is a far pointer to the number of open EMM           ;
  12. ;                        handles.                                             ;
  13. ;                                                                             ;
  14. ;         RETURNED:   status:                                                 ;
  15. ;                        is the status EMM returns from the call.  All other  ;
  16. ;                        returned results are valid only if the status        ;
  17. ;                        returned is zero.  Otherwise they are undefined.     ;
  18. ;                                                                             ;
  19. ;                     handle_count:                                           ;
  20. ;                        is the number of open EMM handles [including the     ;
  21. ;                        operating system handle (0)].  This number will not  ;
  22. ;                        exceed 255.                                          ;
  23. ;                                                                             ;
  24. ; C USE CONVENTION:   unsigned int status;                                    ;
  25. ;                     unsigned int handle_count;                              ;
  26. ;                                                                             ;
  27. ;                     status = get_handle_count (&handle_count);              ;
  28. ;-----------------------------------------------------------------------------;
  29. .XLIST
  30. PAGE    60,132
  31.  
  32. IFDEF SMALL
  33.    .MODEL SMALL, C
  34. ENDIF
  35. IFDEF MEDIUM
  36.    .MODEL MEDIUM, C
  37. ENDIF
  38. IFDEF LARGE
  39.    .MODEL LARGE, C
  40. ENDIF
  41. IFDEF COMPACT
  42.    .MODEL COMPACT, C
  43. ENDIF
  44. IFDEF HUGE
  45.    .MODEL HUGE, C
  46. ENDIF
  47.  
  48. INCLUDE emmlib.equ
  49. INCLUDE emmlib.str
  50. INCLUDE emmlib.mac
  51. .LIST
  52. .CODE
  53.  
  54. get_handle_count    PROC                                                  \
  55.             ptr_handle_count:FAR PTR WORD
  56.  
  57.     ;---------------------------------------------------------------------;
  58.     ;   do;                                                               ;
  59.     ;   .   get the number of active handles from EMM;                    ;
  60.     ;---------------------------------------------------------------------;
  61.     MOVE        AH, get_handle_count_fcn
  62.     INT         EMM_int
  63.  
  64.     ;---------------------------------------------------------------------;
  65.     ;   .   pass the number of active handles back to the caller;         ;
  66.     ;---------------------------------------------------------------------;
  67.     MOVE        DX, BX
  68.     MOVE        ES:BX, ptr_handle_count
  69.     MOVE        ES:[BX], DX
  70.  
  71.     ;---------------------------------------------------------------------;
  72.     ;   .   return (EMM status);                                          ;
  73.     ;   end;                                                              ;
  74.     ;---------------------------------------------------------------------;
  75.     RET_EMM_STAT    AH
  76.  
  77. get_handle_count    ENDP
  78.  
  79. END
  80.